-
Notifications
You must be signed in to change notification settings - Fork 159
Fixed wrongly returning error for valid descriptions #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed wrongly returning error for valid descriptions #270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix @svera ! Please see my comments
Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
|
||
if (stripos($tokens[$isShortDescriptionPreviousVar]['content'], $tokens[$string]['content']) !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that $isShortDescriptionPreviousVar is not false before using it as an array key
Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Sergii Ivashchenko <serg.ivashchenko@gmail.com>
Co-authored-by: Sergii Ivashchenko <serg.ivashchenko@gmail.com>
@magento import pr to magento-commerce/magento-coding-standard |
#140 was wrongly returning error for valid short descriptions. We added several unit tests checking for this issue, as well as not allowing to repeat property class name in short description and rephrasing the error return when a short description is placed after a @var annotation.